home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / bbs / quptst1.zip / PCBTEST.BAT < prev   
DOS Batch File  |  1992-12-28  |  4KB  |  97 lines

  1. rem . This is a quick batch file I threw together to allow quick testing
  2. rem . of newly uploaded files.  Like some, I got tired of the fancy upload
  3. rem . testing programs drawing all of their pretty screens, so I decided
  4. rem . to make up something that works fairly well, and most importantly,
  5. rem . it works quickly.  It is by no means fool proof, but for a quick
  6. rem . perusal of the file, it works fine.
  7. rem .
  8. rem . I guess a quick disclaimer is in order here... I disclaim
  9. rem . everything.  If you use this batch file you are assuming all
  10. rem . liablility for anything that occurs as a result of its use.
  11. rem . You are free to modify, distribute or destroy this batch file in
  12. rem . any way you see fit.
  13. rem .
  14. rem . There are a few parameters which require changing to match your
  15. rem . system setup, I have gone through and marked them for quick
  16. rem . editing.  In order to make this batch file work properly, there
  17. rem . you need to pick up a few more files, and they are as follows.
  18. rem .         TESTFIL3.ZIP   -  to test dates of files
  19. rem .         PCBDESCx.ZIP   -  to pull out FILE_ID.DIZ files
  20. rem .         SENDCOM.ZIP    -  to send messages through the com port
  21. rem .         STRIPZ12.ZIP   -  to strip comments from ZIP files
  22.  
  23.  
  24.  
  25.  
  26. @echo off
  27. md g:\uptest1  <--- change path
  28. sendcom 2 CR   <--- change com port
  29. if not '%2' == 'UPLOAD' goto test_only
  30. sendcom 2 ■ Stripping ZIP file comment
  31. stripzip /R %1
  32. sendcom 2 CR ■ Checking for File_Id.Diz or Desc.Sdi
  33. pcbdesc %1 %3 /D
  34. if errorlevel 5 goto end
  35.  
  36. sendcom 2 CR ■ Checking ZIP file integrity
  37. unzip -t %1
  38. if errorlevel 1 goto bad_zip
  39. unzip %1 *.exe *.com *.sys *.ovl *.zip g:\uptest1 -O  <--- change path
  40. unzip g:\uptest1\*.zip *.exe *.com *.sys *.ovl g:\uptest1 -O  <---change path
  41.  
  42. sendcom 2 CR ■ Scanning for viruses
  43. scan g:\uptest1\*.* /nomem /fast  <--- change path
  44. if errorlevel 1 goto virus_found
  45.  
  46. sendcom 2 CR ■ Testing age of files
  47. testfile 1988 1 g:\uptest1 <--- change path, date and percentage
  48. if errorlevel 1 goto out_dated
  49. goto dup_check
  50.  
  51. :BAD_ZIP
  52. copy %1 d:\rejects <--- change path/make directory
  53. erase %1
  54. echo I'm sorry @FIRST@, @OPTEXT@ has failed the ZIP integrity check. >>PCBFAIL.TXT
  55. echo It has been moved off-line pending further SysOp review. >>PCBFAIL.TXT
  56. goto end
  57.  
  58. :VIRUS_FOUND
  59. copy %1 d:\rejects  <--- change path
  60. erase %1
  61. echo @FIRST@, @OPTEXT@ has been preliminarily flagged as "infected with >>PCBFAIL.TXT
  62. echo a virus".  The file has been moved off-line and the SysOp has been >>PCBFAIL.TXT
  63. echo notified that this file is waiting for his review.  >>PCBFAIL.TXT
  64. goto end
  65.  
  66. :OUT_DATED
  67. copy %1 d:\rejects  <--- change path
  68. erase %1
  69. echo I'm sorry @FIRST@, @OPTEXT@ has been found to be older than 1/1/1988. >>PCBFAIL.TXT
  70. echo In order to keep up-to-date software on the system, I require that >>PCBFAIL.TXT
  71. echo files be newer than this date.  However, the file has been moved >>PCBFAIL.TXT
  72. echo off-line and the SysOp will review your upload. >>PCBFAIL.TXT
  73. goto end
  74.  
  75. :TEST_ONLY
  76. sendcom 2 ■ Testing ZIP file integrity
  77. unzip -t %1  <--- change path
  78. if errorlevel 1 goto bad_zip
  79. unzip %1 *.exe *.com *.ovl *.sys *.zip g:\uptest1  <--- change path
  80. unzip g:\uptest1\*.zip *.exe *.com *.ovl *.sys g:\uptest1 <--- change path
  81. sendcom 2 CR ■ Scanning for viruses
  82. scan g:\uptest1\*.* /nomem /fast  <--- change path
  83. if errorlevel 1 goto virus_found
  84. goto end
  85.  
  86. rem vvvvvvvvvvvvv -- this part can be omitted if you are not using some type of
  87. rem                  CRC duplicate checking program.
  88.  
  89. :DUP_CHECK
  90. sendcom 2 CR ■ Checking for CRC duplication
  91. zdcsfc %1 %2 %3
  92. goto end
  93.  
  94. :end
  95. delete g:\uptest1\*.* <--- change path
  96. rd g:\uptest1 <--- change path
  97.